import axios from "axios";
// eslint-disable-next-line
export default {
    get :({curPage,eachPage})=>axios.get("/api/orders",{
        params:{
            curPage,
            eachPage
        }
    })
    .then(({data})=>data),

    addOrder :({userId, commoditiesId, time,  state, price,orderInfo,count})=>axios.post("/api/orders/add",{
        userId, commoditiesId, time,  state, price,orderInfo,count
    })
    .then(({data})=>data),


    removeOrder :({ _id })=>axios.post("/api/orders/remove",{
        _id
    })
    .then(({status})=>status),

    findOne :( _id )=>axios.get(`/api/orders/findOne/${_id}`)
    .then(({data})=>data),

    
}